<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html class="win-frame">
<head>
<title>${name_china}管理-编辑${name_china}</title>
<%@include file="/common/head.jsp" %>

</head>
<body class="iframe-page">
<div class="page-title-wrapper">
    <div class="page-title">
        <div class="page-title-text">
            <span>${name_china}管理</span>
            <span class="split"></span>
            <span>编辑${name_china}</span>
        </div>
        <a id="goBack" class="btn-return distance-left" href="javascript:;"><i class="icon icon-arrow-left"></i>返回上级</a>
    </div>
    <div class="page-title-border"></div>
</div>

<form id="form" method="post">
    <div class="form-wrapper">
	  <div class="h4 distance-double">
        <span class="h4-title"><i class="icon icon-setting"></i>基本信息</span>
        <span class="h4-border"></span>
      </div>
      
      <input type="hidden" id="id" name="id"/> 
      
     	    
	     <div class="form-cont">
	        <p class="form-cont-title">排序号</p>
	        <input type="text" id="reorder" name="reorder" class="summer-input summer-validatebox"  data-validatebox="validType:['noNegativeNumber']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title"><span class="field-required">*</span>用户ID</p>
	        <input type="text" id="userId" name="userId" class="summer-input summer-validatebox"  data-validatebox="validType:['required','maxLength[50]']"/> 
	     </div> 
	     
	     <div class="form-cont">
	        <p class="form-cont-title">用户名</p>
	        <input type="text" id="userNickName" name="userNickName" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[11]']"/> 
	     </div>
	     
	      <div class="form-cont">
	        <p class="form-cont-title">收货人姓名</p>
	        <input type="text" id="reciever" name="reciever" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[11]']"/> 
	     </div>
	     
	      <div class="form-cont">
	        <p class="form-cont-title">收货人电话</p>
	        <input type="text" id="phone" name="phone" class="summer-input"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">收货人地址</p>
	        <input type="text" id="address" name="address" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品IDS</p>
	        <input type="text" id="goodsId" name="goodsId" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品名称</p>
	        <input type="text" id="goodsName" name="goodsName" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品图片</p>
	        <input type="text" id="goodsImg" name="goodsImg" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品原价</p>
	        <input type="text" id="goodsOriginprice" name="goodsOriginprice" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品折后价</p>
	        <input type="text" id="goodsDiscountPrice" name="goodsDiscountPrice" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品颜色</p>
	        <input type="text" id="goodsColor" name="goodsColor" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">商品尺寸</p>
	        <input type="text" id="goodsSize" name="goodsSize" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">数量</p>
	        <input type="text" id="count" name="count" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否折扣价</p>
	        <input type="text" id="isDiscount" name="isDiscount" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否使用红包</p>
	        <input type="text" id="isRedpac" name="isRedpac" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">物流费用</p>
	        <input type="text" id="transfee" name="transfee" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">实际支付金额</p>
	        <input type="text" id="actualPay" name="actualPay" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否退换</p>
	        <input type="text" id="isReturn" name="isReturn" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">订单号</p>
	        <input type="text" id="orderNo" name="orderNo" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">支付交易号</p>
	        <input type="text" id="payNo" name="payNo" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	   
	     <div class="form-cont">
	        <p class="form-cont-title">付款时间</p>
	        <input type="text" id="payTime" name="payTime" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">红包金额</p>
	        <input type="text" id="redpacAmount" name="redpacAmount" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">店铺ID</p>
	        <input type="text" id="storeId" name="storeId" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">店铺名称</p>
	        <input type="text" id="storeName" name="storeName" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>

	     <div class="form-cont">
	        <p class="form-cont-title">订单开始时间</p>
	        <input type="text" id="startTime" name="startTime" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">订单结束时间</p>
	        <input type="text" id="endTime" name="endTime" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">发货时间</p>
	        <input type="text" id="transTime" name="transTime" class="summer-input summer-validatebox"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	    
	     
	     <div class="form-cont">
	        <p class="form-cont-title">折扣券ID</p>
	        <input type="text" id="couponId" name="couponId" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">店铺ID</p>
	        <input type="text" id="storeId" name="storeId" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">物流ID</p>
	        <input type="text" id="transId" name="transId" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">订单状态</p>
	        <input type="text" id="state" name="state" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">售后申请ID</p>
	        <input type="text" id="afterSaleAppid" name="afterSaleAppid" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">评论ID</p>
	        <input type="text" id="judgeId" name="judgeId" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否展示退货按钮</p>
	        <input type="text" id="isShowCancel" name="isShowCancel" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否展示换货按钮</p>
	        <input type="text" id="isShowChange" name="isShowChange" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">是否展示维修按钮</p>
	        <input type="text" id="isShowFix" name="isShowFix" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">订单类型（友惠家）</p>
	        <input type="text" id="type" name="type" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title">售后处理状态</p>
	        <input type="text" id="aftersaleState" name="aftersaleState" class="summer-input summer-validatebox"  data-validatebox="validType:['maxLength[50]']"/> 
	     </div>
	     
	     
     <div class="form-btn-wrapper" id="funcbar">
        <a class="btn btn-normal" id="backBtn">关闭</a>
    </div>
  </div>
</form>
<script>
    
  var   editData,
        permission = CommonUtil.getPermission('${name_english}');
    
    $(function () {
    	editData = ${editData};
    	
    	//初始化funcbar
     	$('#funcbar').prepend($.funcbar({
            type: 'button',
            data: permission,
            permit: ['${name_english}:edit']
        }));
   	 
	//下拉初始化
		$('#isDiscount').combobox({
			async : false,
			defaultValue : editData.isDiscount,
			valueField : 'code',
			textField : 'name',
			url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_IS_DISCOUNT'
		});

		$('#isRedpac').combobox({
			async : false,
			defaultValue : editData.isRedpac,
			valueField : 'code',
			textField : 'name',
			url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_IS_REDPAC'
		});

		$('#isReturn').combobox({
			async : false,
			defaultValue : editData.isReturn,
			valueField : 'code',
			textField : 'name',
			url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_IS_RETURN'
		});

		$('#state').combobox({
			async : false,
			defaultValue : editData.state,
			valueField : 'code',
			textField : 'name',
			url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_STATE'
		});

		$('#isShowCancel').combobox({
			async : false,
			defaultValue : editData.isShowCancel,
			valueField : 'code',
			textField : 'name',
			url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_IS_SHOW_CANCEL'
		});

		$('#isShowChange').combobox({
			async : false,
			defaultValue : editData.isShowChange,
			valueField : 'code',
			textField : 'name',
			url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_IS_SHOW_CHANGE'
		});

		$('#isShowFix').combobox({
			async : false,
			defaultValue : editData.isShowFix,
			valueField : 'code',
			textField : 'name',
			url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_IS_SHOW_FIX'
		});
		
		$('#aftersaleState').combobox({
			async : false,
			defaultValue : editData.aftersaleState,
			valueField : 'code',
			textField : 'name',
			url : COMMON_URL.getCode + '?type=T_DM_T_ORDER_DETAIL_AFTERSALE_STATE'
		});
		
		$('#form').form({
			onLoadSuccess : function(data) {

			}
		}).form('loadDataEdit', {
			data : editData
		});

		//保存按钮
		$('#funcbar').on('click', 'a[data-permit="${name_english}:edit"]',
				submit);

		//返回按钮
		$('#backBtn, #goBack').on('click', backMain);
	});

	//表单提交
	function submit() {
		$("#form").form({
			buttons : [ '#saveBtn' ],
			ajax : {
				url : CONST_URL.EDIT
			},
			onSubmitSuccess : function(data) {
				$.stip({
					type : 'ok',//显示类型 有info、 ok、 danger
					text : '保存成功！',
					onBeforeHide : function() {
						backMain();
					}
				});
			}
		}).form("submit");
	}

	//返回主页面
	function backMain() {
		window.location.href = CONST_URL.INIT_MAIN;
	}

	//请求url
	var CONST_URL = {
		INIT_MAIN : basePath + "${common_url}init",
		EDIT : basePath + "${common_url}edit"
	};
</script>
</body>
</html>